<%--
  Created by IntelliJ IDEA.
  User: 61741
  Date: 2017/12/4
  Time: 21:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <title>厂商/代理商黄页</title>
    <meta charset="utf-8">
    <jsp:include page="../common/portal-head.jsp"></jsp:include>
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/portal/css/seller.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/portal/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/portal/css/checkbox.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/portal/css/page.css">
</head>
<body>
<div class="page-container">
    <jsp:include page="../portal/topmenu.jsp"></jsp:include>
    <jsp:include page="../portal/slider.jsp"></jsp:include>
    <div class="content-wrap">
        <div class="top-seller-wrap">
            <h1 class="seller-title">明星企业</h1>
            <div class="next-list-but">
                <div class="title-bot-line">
                </div>
                <img src="${ctx}/resources/portal/img/next.png">
                <img src="${ctx}/resources/portal/img/pre.png">

            </div>
            <div class="top-seller-list" id="starCompany">
                <div class="top-seller-item">
                    <img class="seller-pic" src="${ctx}/resources/portal/img/banner/seller-01.jpg">
                    <div class="seller-dsc">
                        <div class="seller-dsc-inline">
                            <span class="seller-dsc-name">内衣巴巴平台企业名称</span>
                            <span class="seller-dsc-content">本周优秀企业，交易量:1000单,下单立享9折优惠。点击查看详情>></span>
                        </div>
                    </div>
                </div>
                <div class="top-seller-item">
                    <img class="seller-pic" src="${ctx}/resources/portal/img/banner/seller-02.jpg">
                    <div class="seller-dsc">
                        <div class="seller-dsc-inline">
                            <span class="seller-dsc-name">内衣巴巴平台企业名称</span>
                            <span class="seller-dsc-content">本周优秀企业，交易量:1000单,下单立享9折优惠。点击查看详情>></span>
                        </div>
                    </div>
                </div>
                <div class="top-seller-item">
                    <img class="seller-pic" src="${ctx}/resources/portal/img/banner/seller-01.jpg">
                    <div class="seller-dsc">
                        <div class="seller-dsc-inline">
                            <span class="seller-dsc-name">内衣巴巴平台企业名称</span>
                            <span class="seller-dsc-content">本周优秀企业，交易量:1000单,下单立享9折优惠。点击查看详情>></span>
                        </div>
                    </div>
                </div>
                <div class="top-seller-item">
                    <img class="seller-pic" src="${ctx}/resources/portal/img/banner/seller-02.jpg">
                    <div class="seller-dsc">
                        <div class="seller-dsc-inline">
                            <span class="seller-dsc-name">内衣巴巴平台企业名称</span>
                            <span class="seller-dsc-content">本周优秀企业，交易量:1000单,下单立享9折优惠。点击查看详情>></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="search-wrap">
            <div class="search-box-wrap">
                <div class="search-options">
                    <div class="search-options-item">
                        <span>生产类型 :</span>
                        <div class="check-lable"><input type="checkbox" name="seller" id="self-seller" onclick="changecheck(this)">
                            <img class="checked-logo" src="${ctx}/resources/portal/img/checked.png">
                        </div>
                        <label>自产</label>
                        <div class="check-lable"><input type="checkbox" name="seller" id="other-seller" onclick="changecheck(this)">
                            <img class="checked-logo" src="${ctx}/resources/portal/img/checked.png">
                        </div>
                        <label>其他货源</label>
                    </div>
                    <div class="search-options-item">
                        <span>价格范围 :</span>
                        <input type="text" class="search-price">
                        <span class="between-price">—</span>
                        <input type="text" class="search-price">
                    </div>
                    <div class="search-options-item">
                        <span class="branch-title">品牌 :</span>
                        <ul class="brand-list">
                            <li><a her="">都市丽人</a></li>
                            <li><a her="">三枪</a></li>
                            <li><a her="">阿玛尼</a></li>
                            <li><a her="">健将</a></li>
                            <li>
                                <div class="dropdown-title">
                                    <a>展开<img src="${ctx}/resources/portal/img/downlist.png"></a>
                                    <div class="dropdown-content">
                                        <a class="branch-link" href="">阿玛尼</a>
                                        <a class="branch-link" href="">三枪</a>
                                        <a class="branch-link" href="">健将</a>
                                        <a class="branch-link" href="">都市丽人</a>
                                        <a class="branch-link" href="">阿玛尼</a>
                                        <a class="branch-link" href="">三枪</a>
                                        <a class="branch-link" href="">健将</a>
                                        <a class="branch-link" href="">都市丽人</a>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="search-box">
                    <div class="search-box-input">
                        <select>
                            <option>深圳</option>
                        </select>
                        <input type="text" id="keyword" name="keyword" placeholder="请输入关键词检索资讯内容" />
                        <button class="serach-button">搜索</button>
                    </div>
                    <div class="brach-advise">
                        <span>内衣</span>
                        <a>三枪</a>
                        <a>阿玛尼</a>
                        <a>都市丽人</a>
                    </div>
                </div>
            </div>
            <div class="search-fillter-wrap">
                <div class="seller-filiter">
                    <span>区域</span>
                    <img src="${ctx}/resources/portal/img/down_list.png">
                </div>
                <div class="seller-filiter">
                    <span>类别</span>
                    <img src="${ctx}/resources/portal/img/down_list.png">
                </div>
                <div class="sale-num">
                    <span>店铺销量</span>
                    <img src="${ctx}/resources/portal/img/num_up.png" class="num-up-pic">
                </div>
            </div>
        </div>
        <div class="seller-list-wrap" id="companyList">
            <div class="seller-list-item">
                <img src="${ctx}/resources/portal/img/banner/seller-02.jpg" class="seller-list-pic">
                <div class="seller-detail-info">
                    <h1>内衣巴巴平台企业名称</h1>
                    <p>汕头市远洋博信有限公司 专业生产批发 情侣内裤、男士内裤、女士内裤 畅销消费者市场，在消费者当中享有较高的地位，公司与多家零售商和代理商建立了长期稳定的合作关系。公司生产经销的产品品种齐全、价格合理。公司实力雄厚，重信用、守合同、保证产品质量，以多品种经营特色和薄利多销的原则，赢得了广大客户的信任。</p>
                    <div class="seller-add-phone">
                        <img src="${ctx}/resources/portal/img/address.png">
                        <span>企业地址:广东汕头贵屿镇新厝村环市路西南畔 </span>
                        <img src="${ctx}/resources/portal/img/phone.png">
                        <span>联系方式:0754-84446186 </span>
                    </div>
                </div>
                <img src="${ctx}/resources/portal/img/before_collect.png" class="collection-before" id="collect-pic-1" alt="0" onclick="collect('collect-pic-1')">
            </div>
            <div class="seller-list-item">
                <img src="${ctx}/resources/portal/img/banner/seller-02.jpg" class="seller-list-pic">
                <div class="seller-detail-info">
                    <h1>内衣巴巴平台企业名称</h1>
                    <p>汕头市远洋博信有限公司 专业生产批发 情侣内裤、男士内裤、女士内裤 畅销消费者市场，在消费者当中享有较高的地位，公司与多家零售商和代理商建立了长期稳定的合作关系。公司生产经销的产品品种齐全、价格合理。公司实力雄厚，重信用、守合同、保证产品质量，以多品种经营特色和薄利多销的原则，赢得了广大客户的信任。</p>
                    <div class="seller-add-phone">
                        <img src="${ctx}/resources/portal/img/address.png">
                        <span>企业地址:广东汕头贵屿镇新厝村环市路西南畔 </span>
                        <img src="${ctx}/resources/portal/img/phone.png">
                        <span>联系方式:0754-84446186 </span>
                    </div>
                </div>
                <img src="${ctx}/resources/portal/img/before_collect.png" class="collection-before" id="collect-pic-2" alt="0" onclick="collect('collect-pic-2')">
            </div>
            <div class="seller-list-item">
                <img src="${ctx}/resources/portal/img/banner/seller-02.jpg" class="seller-list-pic">
                <div class="seller-detail-info">
                    <h1>内衣巴巴平台企业名称</h1>
                    <p>汕头市远洋博信有限公司 专业生产批发 情侣内裤、男士内裤、女士内裤 畅销消费者市场，在消费者当中享有较高的地位，公司与多家零售商和代理商建立了长期稳定的合作关系。公司生产经销的产品品种齐全、价格合理。公司实力雄厚，重信用、守合同、保证产品质量，以多品种经营特色和薄利多销的原则，赢得了广大客户的信任。</p>
                    <div class="seller-add-phone">
                        <img src="${ctx}/resources/portal/img/address.png">
                        <span>企业地址:广东汕头贵屿镇新厝村环市路西南畔 </span>
                        <img src="${ctx}/resources/portal/img/phone.png">
                        <span>联系方式:0754-84446186 </span>
                    </div>
                </div>
                <img src="${ctx}/resources/portal/img/before_collect.png" class="collection-before" id="collect-pic-3" alt="0" onclick="collect('collect-pic-3')">
            </div>
            <div class="seller-list-item">
                <img src="${ctx}/resources/portal/img/banner/seller-02.jpg" class="seller-list-pic">
                <div class="seller-detail-info">
                    <h1>内衣巴巴平台企业名称</h1>
                    <p>汕头市远洋博信有限公司 专业生产批发 情侣内裤、男士内裤、女士内裤 畅销消费者市场，在消费者当中享有较高的地位，公司与多家零售商和代理商建立了长期稳定的合作关系。公司生产经销的产品品种齐全、价格合理。公司实力雄厚，重信用、守合同、保证产品质量，以多品种经营特色和薄利多销的原则，赢得了广大客户的信任。</p>
                    <div class="seller-add-phone">
                        <img src="${ctx}/resources/portal/img/address.png">
                        <span>企业地址:广东汕头贵屿镇新厝村环市路西南畔 </span>
                        <img src="${ctx}/resources/portal/img/phone.png">
                        <span>联系方式:0754-84446186 </span>
                    </div>
                </div>
                <img src="${ctx}/resources/portal/img/before_collect.png" class="collection-before" id="collect-pic-4" alt="0" onclick="collect('collect-pic-4')">
            </div>
            <div class="seller-list-item">
                <img src="${ctx}/resources/portal/img/banner/seller-02.jpg" class="seller-list-pic">
                <div class="seller-detail-info">
                    <h1>内衣巴巴平台企业名称</h1>
                    <p>汕头市远洋博信有限公司 专业生产批发 情侣内裤、男士内裤、女士内裤 畅销消费者市场，在消费者当中享有较高的地位，公司与多家零售商和代理商建立了长期稳定的合作关系。公司生产经销的产品品种齐全、价格合理。公司实力雄厚，重信用、守合同、保证产品质量，以多品种经营特色和薄利多销的原则，赢得了广大客户的信任。</p>
                    <div class="seller-add-phone">
                        <img src="${ctx}/resources/portal/img/address.png">
                        <span>企业地址:广东汕头贵屿镇新厝村环市路西南畔 </span>
                        <img src="${ctx}/resources/portal/img/phone.png">
                        <span>联系方式:0754-84446186 </span>
                    </div>
                </div>
                <img src="${ctx}/resources/portal/img/before_collect.png" class="collection-before" id="collect-pic-5" alt="0" onclick="collect('collect-pic-5')">
            </div>
        </div>
        <div id="page" class="page_div"></div>
    </div>
</div>
<jsp:include page="../portal/footer.jsp"></jsp:include>
<script src="${ctx}/resources/portal/script/page.js" type="text/javascript"></script>

<script id="slider-tml" type="text/html">
    <li><img src="\${url}"></li>
</script>

<script id="starcompany-tml" type="text/html">
    <div class="top-seller-item">
        <img class="seller-pic" src="\${companyPics[0]}">
        <div class="seller-dsc">
            <div class="seller-dsc-inline">
                <span class="seller-dsc-name">\${companyName}</span>
                <span class="seller-dsc-content">本周优秀企业点击查看详情>></span>
            </div>
        </div>
    </div>
</script>

<script id="companyList-tml" type="text/html">
    <div class="seller-list-item">
        <img src="\${userLogo}" class="seller-list-pic">
        <div class="seller-detail-info">
            <h1>\${companyName}</h1>
            <p>\${userDsc}</p>
            <div class="seller-add-phone">
                <img src="${ctx}/resources/portal/img/address.png">
                <span>企业地址:\${userAdd.provine}\${userAdd.city}\${userAdd.twon}\${userAdd.detailAddress}</span>
                <img src="${ctx}/resources/portal/img/phone.png">
                <span>联系方式:\${userContact} </span>
            </div>
        </div>
        <img src="${ctx}/resources/portal/img/before_collect.png" class="collection-before" id="$\{id}" alt="0" onclick="collect('$\{id}')">
    </div>
</script>
<script type="text/javascript">
    var scope="PARTS";
    var city="default";
    $(function () {
        loadSlider(city);
        loadStarShop(city);
        loadallshop();
    })
    function loadSlider(city) {
        var data = {city: city};
        asyncAjax({
            url: ctx + "/home/slider/list/"+scope+"?" + $.param(data).replace(/(%5D|%5B)/g, ""),
            success: function (res) {
                if (res["result"] == "0") {
                    if (!isEmpty(res["data"])) {
                        $("#slider-ul").html("");
                        $("#slider-tml").tmpl(res["data"]).appendTo($("#slider-ul"));
                        // 修正轮播图插件图片宽度自适应问题

                        $(".slider-img").attr("style", "width:" + $(".slider-img-ul li").length * 100 + "% !important;");
                        $(".slider-img-ul>li>img").css({
                            width: $(".slider-wrap").width() + "px !important",
                            height: "auto !important"
                        });
                        $(".slider").xSlider({w: 1340});
                    }
                    else {
                        $("#newGood-table").html('<li><img src="${ctx}/resources/portal/img/banner/1-banner.jpg"></li>');
                    }
                }
                else {
                    bootbox.alert(res["msg"]);
                }
            }

        })
    }
    function loadStarShop(city) {
        var data = {pageType: scope,city:city,};
        asyncAjax({
            url: ctx + "/portal/shop/flag/list?" + $.param(data).replace(/(%5D|%5B)/g, ""),
            beforeSend: function (req) {
                $("#starCompany").html('<i class="fa fa-spin fa-spinner"></i>正在刷新数据...');
            },
            success: function (res) {
                //console.log("res:%o", res);
                if (res["result"] == "0") {
                    $("#starCompany").html("");
                    if (!isEmpty(res["data"])) {
                        $("#starcompany-tml").tmpl(res["data"]).appendTo($("#starCompany"));

                    } else {
                        $("#starCompany").html("<div class='alert alert-warning'>该模块尚未配置推广商铺</div>");
                    }
                } else {
                    bootbox.alert(res["msg"]);


                }
            }
        })
    }
    function loadallshop(pageNum){
        var data = {reviewStatus: 2,pageNum:pageNum||1,pageSize:10};
        asyncAjax({
            url: ctx + "/user/mgr/list/4?" + $.param(data).replace(/(%5D|%5B)/g, ""),
            beforeSend: function (req) {
                $("#companyList").html('<i class="fa fa-spin fa-spinner"></i>正在刷新数据...');
            },
            success: function (res) {
                //console.log("res:%o", res);
                if (res["result"] == "0") {
                    $("#companyList").html("");
                    if (!isEmpty(res["data"])) {
                        $("#companyList-tml").tmpl(res["data"]).appendTo($("#companyList"));
                        $("#page").paging({
                            pageNo:pageNum || 1,
                            totalPage:Math.ceil(res.total/10),
                            totalSize: res.total,
                            callback: function(num) {
                                loadallshop(num);
                            }
                        })

                    } else {
                        $("#companyList").html("<div class='alert alert-warning'>该模块尚未配置推广商铺</div>");
                    }
                }  else {
                    bootbox.alert(res["msg"]);
                }
            }
        })

    }
    function changecheck(obj){
        var aa = document.getElementsByName("seller");
        for (var i = 0; i < aa.length; i++) {
            aa[i].checked = false;
        }
        obj.checked = true;
    }
    /*收藏*/
    function collect(collectid){
        var celflag=document.getElementById(collectid).alt;


        if(celflag==0){

            document.getElementById(collectid).src="${ctx}/resources/portal/img/after_collect.png";
            document.getElementById(collectid).alt="1";
        }
        else{
            document.getElementById(collectid).src="${ctx}/resources/portal/img/before_collect.png";
            document.getElementById(collectid).alt="0";
        }

    }
</script>
<script src="${ctx}/resources/portal/script/xSlider.js" type="text/javascript"></script>
</body>
</html>
